home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Main.bin / Owner.java < prev    next >
Text File  |  1998-09-22  |  3KB  |  85 lines

  1. /*
  2.  * @(#)Owner.java    1.9 98/07/01
  3.  *
  4.  * Copyright 1995-1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  * 
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.security.acl;
  16.  
  17. import java.security.Principal;
  18.  
  19. /**
  20.  * Interface for managing owners of Access Control Lists (ACLs) or ACL 
  21.  * configurations. (Note that the Acl interface in the 
  22.  * <code> java.security.acl </code> package extends this Owner
  23.  * interface.) The initial owner Principal should be specified as an 
  24.  * argument to the constructor of the class implementing this interface.   
  25.  *   
  26.  * @see java.security.acl.Acl    
  27.  *
  28.  */
  29. public interface Owner {
  30.  
  31.     /**
  32.      * Adds an owner. Only owners can modify ACL contents. The caller 
  33.      * principal must be an owner of the ACL in order to invoke this method.
  34.      * That is, only an owner can add another owner. The initial owner is 
  35.      * configured at ACL construction time. 
  36.      * 
  37.      * @param caller the principal invoking this method. It must be an owner 
  38.      * of the ACL.
  39.      * 
  40.      * @param owner the owner that should be added to the list of owners.
  41.      * 
  42.      * @return true if successful, false if owner is already an owner.
  43.      * @exception NotOwnerException if the caller principal is not an owner 
  44.      * of the ACL.
  45.      */
  46.     public boolean addOwner(Principal caller, Principal owner)
  47.       throws NotOwnerException;
  48.  
  49.     /** 
  50.      * Deletes an owner. If this is the last owner in the ACL, an exception is 
  51.      * raised.<p>
  52.      * 
  53.      * The caller principal must be an owner of the ACL in order to invoke 
  54.      * this method. 
  55.      * 
  56.      * @param caller the principal invoking this method. It must be an owner 
  57.      * of the ACL.
  58.      * 
  59.      * @param owner the owner to be removed from the list of owners.
  60.      * 
  61.      * @return true if the owner is removed, false if the owner is not part 
  62.      * of the list of owners.
  63.      * 
  64.      * @exception NotOwnerException if the caller principal is not an owner 
  65.      * of the ACL.
  66.      * 
  67.      * @exception LastOwnerException if there is only one owner left, so that
  68.      * deleteOwner would leave the ACL owner-less.
  69.      */
  70.     public boolean deleteOwner(Principal caller, Principal owner)
  71.       throws NotOwnerException, LastOwnerException;
  72.  
  73.     /**
  74.      * Returns true if the given principal is an owner of the ACL.
  75.      * 
  76.      * @param owner the principal to be checked to determine whether or not 
  77.      * it is an owner.
  78.      * 
  79.      * @return true if the passed principal is in the list of owners, false 
  80.      * if not.
  81.      */
  82.     public boolean isOwner(Principal owner);
  83.  
  84. }
  85.